package com.idea.plugin.ui;

import com.intellij.openapi.ui.Messages;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author yanzhao
 * @date 2022/1/26 14:47
 * @since 1.0.0
 */
public class MainPanel extends JPanel {

    public MainPanel() {
        super();
        Button button = new Button();
        button.setLabel("click me");
        this.add(button);

        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                Messages.showMessageDialog("Hello, this is my first plugin.", "Hello world", Messages.getInformationIcon());
            }
        });
    }

}
